<?php
/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * The Moderator service implementation
 *
 * Generated by http://code.google.com/p/google-api-php-client/
 * Generated from: http://www.googleapis.com/discovery/0.1/describe?api=moderator&apiVersion=v1
 **/
class apiModeratorService {

  // Variables that the apiServiceResource implementation depends on
  private $serviceName = 'moderator';
  private $version = 'v1';
  private $baseUrl = 'https://www.googleapis.com/';
  private $io;
  // apiServiceResource's that are used internally
  private $tags;
  private $series;
  private $topics;
  private $votes;
  private $submissions;
  private $profiles;
  private $responses;

  /**
   * Constructs the internal service representations and does the auto-magic configuration required to drive them
   */
  public function __construct(apiClient $apiClient) {
    $apiClient->addService('moderator', 'v1');
    $this->io = $apiClient->getIo();
    $this->tags = new apiServiceResource($this, $this->serviceName, 'tags', json_decode('{"methods":{"delete":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}\/tags\/{tagId}","rpcName":"moderator.tags.delete","httpMethod":"DELETE","methodType":"rest","parameters":{"tagId":{"parameterType":"path","pattern":"[^\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"list":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}\/tags","rpcName":"moderator.tags.list","httpMethod":"GET","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"insert":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}\/tags","rpcName":"moderator.tags.insert","httpMethod":"POST","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->series = new apiServiceResource($this, $this->serviceName, 'series', json_decode('{"methods":{"list":{"pathUrl":"moderator\/v1\/series\/featured","rpcName":"moderator.featured.series.list","httpMethod":"GET","methodType":"rest"},"update":{"pathUrl":"moderator\/v1\/series\/{seriesId}","rpcName":"moderator.series.update","httpMethod":"PUT","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"insert":{"pathUrl":"moderator\/v1\/series","rpcName":"moderator.series.insert","httpMethod":"POST","methodType":"rest"},"get":{"pathUrl":"moderator\/v1\/series\/{seriesId}","rpcName":"moderator.series.get","httpMethod":"GET","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->topics = new apiServiceResource($this, $this->serviceName, 'topics', json_decode('{"methods":{"list":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/topics","rpcName":"moderator.topics.list","httpMethod":"GET","methodType":"rest","parameters":{"max-results":{"parameterType":"query","required":false},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"insert":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/topics","rpcName":"moderator.topics.insert","httpMethod":"POST","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"get":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/topics\/{topicId}","rpcName":"moderator.topics.get","httpMethod":"GET","methodType":"rest","parameters":{"topicId":{"parameterType":"path","pattern":"[^\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->votes = new apiServiceResource($this, $this->serviceName, 'votes', json_decode('{"methods":{"update":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}\/votes\/@me","rpcName":"moderator.votes.update","httpMethod":"PUT","methodType":"rest","parameters":{"userId":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"list":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/votes\/@me","rpcName":"moderator.votes.list","httpMethod":"GET","methodType":"rest","parameters":{"max-results":{"parameterType":"query","required":false},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"get":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}\/votes\/@me","rpcName":"moderator.votes.get","httpMethod":"GET","methodType":"rest","parameters":{"userId":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"insert":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}\/votes\/@me","rpcName":"moderator.votes.insert","httpMethod":"POST","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->submissions = new apiServiceResource($this, $this->serviceName, 'submissions', json_decode('{"methods":{"get":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/submissions\/{submissionId}","rpcName":"moderator.submissions.get","httpMethod":"GET","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"list":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/topics\/{topicId}\/submissions","rpcName":"moderator.topics.submissions.list","httpMethod":"GET","methodType":"rest","parameters":{"author":{"parameterType":"query","required":false},"hasAttachedVideo":{"parameterType":"query","required":false},"sort":{"parameterType":"query","required":false},"max-results":{"parameterType":"query","required":false},"q":{"parameterType":"query","required":false},"topicId":{"parameterType":"path","pattern":"[^\/]+","required":true},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"insert":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/topics\/{topicId}\/submissions","rpcName":"moderator.submissions.insert","httpMethod":"POST","methodType":"rest","parameters":{"topicId":{"parameterType":"path","pattern":"[^\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->profiles = new apiServiceResource($this, $this->serviceName, 'profiles', json_decode('{"methods":{"get":{"pathUrl":"moderator\/v1\/profiles\/@me","rpcName":"moderator.profiles.get","httpMethod":"GET","methodType":"rest"},"update":{"pathUrl":"moderator\/v1\/profiles\/@me","rpcName":"moderator.profiles.update","httpMethod":"PUT","methodType":"rest"}}}', true));
    $this->responses = new apiServiceResource($this, $this->serviceName, 'responses', json_decode('{"methods":{"insert":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/topics\/{topicId}\/submissions\/{parentSubmissionId}\/responses","rpcName":"moderator.responses.insert","httpMethod":"POST","methodType":"rest","parameters":{"parentSubmissionId":{"parameterType":"path","pattern":"[^\/]+","required":true},"topicId":{"parameterType":"path","pattern":"[^\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"list":{"pathUrl":"moderator\/v1\/series\/{seriesId}\/responses","rpcName":"moderator.series.responses.list","httpMethod":"GET","methodType":"rest","parameters":{"author":{"parameterType":"query","required":false},"hasAttachedVideo":{"parameterType":"query","required":false},"sort":{"parameterType":"query","required":false},"max-results":{"parameterType":"query","required":false},"q":{"parameterType":"query","required":false},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
  }

  /**
   * Implementation of the moderator.tags.delete method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.tags.delete
   *
   * @param $tagId required
   * @param $seriesId required
   * @param $submissionId required
   */
  public function deleteTags($tagId, $seriesId, $submissionId) {
    return $this->tags->__call('delete', array(array('tagId' => $tagId, 'seriesId' => $seriesId, 'submissionId' => $submissionId)));
  }

  /**
   * Implementation of the moderator.tags.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.tags.list
   *
   * @param $seriesId required
   * @param $submissionId required
   */
  public function listTags($seriesId, $submissionId) {
    return $this->tags->__call('list', array(array('seriesId' => $seriesId, 'submissionId' => $submissionId)));
  }

  /**
   * Implementation of the moderator.tags.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.tags.insert
   *
   * @param $seriesId required
   * @param $submissionId required
   * @param $postBody required
   */
  public function insertTags($seriesId, $submissionId, $postBody) {
    return $this->tags->__call('insert', array(array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.featured.series.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.featured.series.list
   *
   */
  public function listSeries() {
    return $this->series->__call('list', array(array()));
  }

  /**
   * Implementation of the moderator.series.update method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.series.update
   *
   * @param $seriesId required
   * @param $postBody required
   */
  public function updateSeries($seriesId, $postBody) {
    return $this->series->__call('update', array(array('seriesId' => $seriesId, 'postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.series.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.series.insert
   *
   * @param $postBody required
   */
  public function insertSeries($postBody) {
    return $this->series->__call('insert', array(array('postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.series.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.series.get
   *
   * @param $seriesId required
   */
  public function getSeries($seriesId) {
    return $this->series->__call('get', array(array('seriesId' => $seriesId)));
  }

  /**
   * Implementation of the moderator.topics.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.topics.list
   *
   * @param $seriesId required
   * @param $max_results optional
   * @param $start_index optional
   */
  public function listTopics($seriesId, $max_results = null, $start_index = null) {
    return $this->topics->__call('list', array(array('seriesId' => $seriesId, 'max-results' => $max_results, 'start-index' => $start_index)));
  }

  /**
   * Implementation of the moderator.topics.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.topics.insert
   *
   * @param $seriesId required
   * @param $postBody required
   */
  public function insertTopics($seriesId, $postBody) {
    return $this->topics->__call('insert', array(array('seriesId' => $seriesId, 'postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.topics.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.topics.get
   *
   * @param $topicId required
   * @param $seriesId required
   */
  public function getTopics($topicId, $seriesId) {
    return $this->topics->__call('get', array(array('topicId' => $topicId, 'seriesId' => $seriesId)));
  }

  /**
   * Implementation of the moderator.votes.update method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.votes.update
   *
   * @param $seriesId required
   * @param $submissionId required
   * @param $postBody required
   * @param $userId optional
   */
  public function updateVotes($seriesId, $submissionId, $postBody, $userId = null) {
    return $this->votes->__call('update', array(array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody, 'userId' => $userId)));
  }

  /**
   * Implementation of the moderator.votes.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.votes.list
   *
   * @param $seriesId required
   * @param $max_results optional
   * @param $start_index optional
   */
  public function listVotes($seriesId, $max_results = null, $start_index = null) {
    return $this->votes->__call('list', array(array('seriesId' => $seriesId, 'max-results' => $max_results, 'start-index' => $start_index)));
  }

  /**
   * Implementation of the moderator.votes.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.votes.get
   *
   * @param $seriesId required
   * @param $submissionId required
   * @param $userId optional
   */
  public function getVotes($seriesId, $submissionId, $userId = null) {
    return $this->votes->__call('get', array(array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'userId' => $userId)));
  }

  /**
   * Implementation of the moderator.votes.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.votes.insert
   *
   * @param $seriesId required
   * @param $submissionId required
   * @param $postBody required
   */
  public function insertVotes($seriesId, $submissionId, $postBody) {
    return $this->votes->__call('insert', array(array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.submissions.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.submissions.get
   *
   * @param $seriesId required
   * @param $submissionId required
   */
  public function getSubmissions($seriesId, $submissionId) {
    return $this->submissions->__call('get', array(array('seriesId' => $seriesId, 'submissionId' => $submissionId)));
  }

  /**
   * Implementation of the moderator.topics.submissions.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.topics.submissions.list
   *
   * @param $topicId required
   * @param $seriesId required
   * @param $author optional
   * @param $hasAttachedVideo optional
   * @param $sort optional
   * @param $max_results optional
   * @param $q optional
   * @param $start_index optional
   */
  public function listSubmissions($topicId, $seriesId, $author = null, $hasAttachedVideo = null, $sort = null, $max_results = null, $q = null, $start_index = null) {
    return $this->submissions->__call('list', array(array('topicId' => $topicId, 'seriesId' => $seriesId, 'author' => $author, 'hasAttachedVideo' => $hasAttachedVideo, 'sort' => $sort, 'max-results' => $max_results, 'q' => $q, 'start-index' => $start_index)));
  }

  /**
   * Implementation of the moderator.submissions.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.submissions.insert
   *
   * @param $topicId required
   * @param $seriesId required
   * @param $postBody required
   */
  public function insertSubmissions($topicId, $seriesId, $postBody) {
    return $this->submissions->__call('insert', array(array('topicId' => $topicId, 'seriesId' => $seriesId, 'postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.profiles.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.profiles.get
   *
   */
  public function getProfiles() {
    return $this->profiles->__call('get', array(array()));
  }

  /**
   * Implementation of the moderator.profiles.update method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.profiles.update
   *
   * @param $postBody required
   */
  public function updateProfiles($postBody) {
    return $this->profiles->__call('update', array(array('postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.responses.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.responses.insert
   *
   * @param $parentSubmissionId required
   * @param $topicId required
   * @param $seriesId required
   * @param $postBody required
   */
  public function insertResponses($parentSubmissionId, $topicId, $seriesId, $postBody) {
    return $this->responses->__call('insert', array(array('parentSubmissionId' => $parentSubmissionId, 'topicId' => $topicId, 'seriesId' => $seriesId, 'postBody' => $postBody)));
  }

  /**
   * Implementation of the moderator.series.responses.list method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#moderator.series.responses.list
   *
   * @param $seriesId required
   * @param $author optional
   * @param $hasAttachedVideo optional
   * @param $sort optional
   * @param $max_results optional
   * @param $q optional
   * @param $start_index optional
   */
  public function listResponses($seriesId, $author = null, $hasAttachedVideo = null, $sort = null, $max_results = null, $q = null, $start_index = null) {
    return $this->responses->__call('list', array(array('seriesId' => $seriesId, 'author' => $author, 'hasAttachedVideo' => $hasAttachedVideo, 'sort' => $sort, 'max-results' => $max_results, 'q' => $q, 'start-index' => $start_index)));
  }

  /**
   * @return the $io
   */
  public function getIo() {
    return $this->io;
  }

  /**
   * @param $io the $io to set
   */
  public function setIo($io) {
    $this->io = $io;
  }

  /**
   * @return the $version
   */
  public function getVersion() {
    return $this->version;
  }

  /**
   * @return the $baseUrl
   */
  public function getBaseUrl() {
    return $this->baseUrl;
  }

  /**
   * @param $version the $version to set
   */
  public function setVersion($version) {
    $this->version = $version;
  }

  /**
   * @param $baseUrl the $baseUrl to set
   */
  public function setBaseUrl($baseUrl) {
    $this->baseUrl = $baseUrl;
  }
    
}

